window.getComputedStyle(document.getElementById("mydivID"),null).getPropertyValue('display')
// Where el is the DOM element you'd like to test for visibility
function isHidden(el) {
var style = window.getComputedStyle(el);
return (style.display === 'none')
}
from selenium.common.exceptions import NoSuchElementException
try:
element=driver.find_element_by_partial_link_text("text")
except NoSuchElementException:
print("No element found")